<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>实现交换数组中两个元素的功能</title>
	<script type="text/javascript">
		var arr=[0,1,2,3,4,5];
		function getExchange(arr,index1,index2){
			var temp=arr[index1];
			arr[index1]=arr[index2];
			arr[index2]=temp;
			console.log(arr);
		}
		getExchange(arr,1,5);
	</script>
</head>
<body>
	
</body>
</html>